package cn.iocoder.yudao.module.api.promotion.groupon.dto;

import cn.hutool.core.collection.CollUtil;
import cn.iocoder.yudao.module.api.product.sku.dto.PriceRespDTO;
import cn.iocoder.yudao.module.api.promotion.gift.dto.GiftActivityVO;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.time.LocalDateTime;
import java.util.List;

/**
 * <pre>
 * OOoO0OOoO0OOOooo0oOOOO0OOOOO0oooOO0ooOOO0Ooooo0OOOOo0ooooO0OOooo0Ooooo0OOOOO
 *  这里是文件说明
 * OOoO0OOoO0OOOooo0oOOOO0OOOOO0oooOO0ooOOO0Ooooo0OOOOo0ooooO0OOooo0Ooooo0OOOOO
 * </pre>
 *
 * @author 山野羡民（1032694760@qq.com）
 * @since 2025/01/18
 */
@Data
public class GrouponPackageRespDTO extends PriceRespDTO {

    @Schema(description = "店铺编号")
    private Long shopId;

    @Schema(description = "名称")
    private String name;

    @Schema(description = "图集")
    private List<String> picUrls;

    @Schema(description = "封面图片")
    private String picUrl;

    public String getPicUrl() {
        List<String> pu = getPicUrls();
        if (CollUtil.isNotEmpty(pu)) {
            return pu.get(0);
        }
        return "";
    }

    @Schema(description = "最少适用人数")
    private Integer minPeople;

    @Schema(description = "最多适用人数")
    private Integer maxPeople;

    @Schema(description = "原价，单位为分，自动从团购产品累加得来")
    private Integer originPrice;

    @Schema(description = "生效时间")
    private LocalDateTime startTime;

    @Schema(description = "作废时间")
    private LocalDateTime endTime;

    @Schema(description = "包含产品信息")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private List<GrouponProductRespDTO> products;

    @Schema(description = "包含赠品活动信息")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private List<GiftActivityVO> giftActivities;

}
